package com.zc58s.controller;

import com.zc58s.utils.R;
import com.zc58s.entity.User;
import com.zc58s.utils.Decrypt;
import com.zc58s.utils.Encrypt;
import org.springframework.web.bind.annotation.*;

/**
 * @author : fujc-dev@qq.com
 * @created : 2022/10/19 8:51
 */


@RestController
@RequestMapping()
public class UserController {


    @GetMapping("/user")
    @Encrypt
    public R getUser() {
        User user = new User();
        user.setId((long) 99);
        user.setUsername("javaboy");
        return R.ok("ok", user);
    }

    @PostMapping("/user")
    public R addUser(@RequestBody @Decrypt User user) {
        System.out.println("user = " + user);
        return R.ok("ok", user);
    }
}